home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / phone_no / phone_no.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-11-29  |  4.4 KB  |  158 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H0080FF80&
  4.    Caption         =   "Alpha Phone Numbers"
  5.    ClientHeight    =   3135
  6.    ClientLeft      =   2340
  7.    ClientTop       =   2010
  8.    ClientWidth     =   3525
  9.    Height          =   3540
  10.    Left            =   2280
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3135
  13.    ScaleWidth      =   3525
  14.    Top             =   1665
  15.    Width           =   3645
  16.    Begin MaskEdBox mskPhone 
  17.       FontBold        =   -1  'True
  18.       FontItalic      =   0   'False
  19.       FontName        =   "MS Sans Serif"
  20.       FontSize        =   12
  21.       FontStrikethru  =   0   'False
  22.       FontUnderline   =   0   'False
  23.       Height          =   420
  24.       Left            =   240
  25.       Mask            =   "####"
  26.       MaxLength       =   4
  27.       PromptChar      =   "_"
  28.       TabIndex        =   0
  29.       Top             =   1080
  30.       Width           =   1215
  31.    End
  32.    Begin ListBox List1 
  33.       FontBold        =   -1  'True
  34.       FontItalic      =   0   'False
  35.       FontName        =   "MS Sans Serif"
  36.       FontSize        =   12
  37.       FontStrikethru  =   0   'False
  38.       FontUnderline   =   0   'False
  39.       Height          =   1830
  40.       Left            =   1800
  41.       Sorted          =   -1  'True
  42.       TabIndex        =   2
  43.       Top             =   840
  44.       Width           =   1215
  45.    End
  46.    Begin CommandButton Command1 
  47.       Caption         =   "Fill List"
  48.       Height          =   495
  49.       Left            =   240
  50.       TabIndex        =   1
  51.       Top             =   2040
  52.       Width           =   1215
  53.    End
  54.    Begin Label Label2 
  55.       BackColor       =   &H00000000&
  56.       BackStyle       =   0  'Transparent
  57.       Caption         =   "Enter the last four digits of your phone number and hit fill list.  This will calculate all possible words."
  58.       Height          =   735
  59.       Left            =   120
  60.       TabIndex        =   5
  61.       Top             =   0
  62.       Width           =   3255
  63.    End
  64.    Begin Label lblPhone 
  65.       BackStyle       =   0  'Transparent
  66.       Caption         =   "Phone Number"
  67.       FontBold        =   -1  'True
  68.       FontItalic      =   0   'False
  69.       FontName        =   "MS Sans Serif"
  70.       FontSize        =   13.5
  71.       FontStrikethru  =   0   'False
  72.       FontUnderline   =   0   'False
  73.       Height          =   375
  74.       Left            =   240
  75.       TabIndex        =   4
  76.       Top             =   720
  77.       Width           =   1335
  78.    End
  79.    Begin Label Label1 
  80.       BackStyle       =   0  'Transparent
  81.       Caption         =   "List Count: 0"
  82.       Height          =   255
  83.       Left            =   1800
  84.       TabIndex        =   3
  85.       Top             =   2760
  86.       Width           =   1215
  87.    End
  88. Option Explicit
  89. Sub Command1_Click ()
  90. list1.Clear
  91. ReDim letters(1 To 4, 1 To 4) As String
  92. Dim mydata As String
  93. Dim cnt As Integer
  94. Dim cnt2 As Integer
  95. mydata = mskPhone.ClipText
  96. For cnt = 1 To 4
  97. letters(cnt, 1) = ""
  98. letters(cnt, 1) = Mid$(mydata, cnt, 1)
  99. Next cnt
  100. For cnt2 = 1 To 4
  101. Select Case letters(cnt2, 1)
  102.     Case "2"
  103.     letters(cnt2, 2) = "A"
  104.     letters(cnt2, 3) = "B"
  105.     letters(cnt2, 4) = "C"
  106.     Case "3"
  107.     letters(cnt2, 2) = "D"
  108.     letters(cnt2, 3) = "E"
  109.     letters(cnt2, 4) = "F"
  110.     Case "4"
  111.     letters(cnt2, 2) = "G"
  112.     letters(cnt2, 3) = "H"
  113.     letters(cnt2, 4) = "I"
  114.     Case "5"
  115.     letters(cnt2, 2) = "J"
  116.     letters(cnt2, 3) = "K"
  117.     letters(cnt2, 4) = "L"
  118.     Case "6"
  119.     letters(cnt2, 2) = "M"
  120.     letters(cnt2, 3) = "N"
  121.     letters(cnt2, 4) = "O"
  122.     Case "7"
  123.     letters(cnt2, 2) = "P"
  124.     letters(cnt2, 3) = "R"
  125.     letters(cnt2, 4) = "S"
  126.     Case "8"
  127.     letters(cnt2, 2) = "T"
  128.     letters(cnt2, 3) = "U"
  129.     letters(cnt2, 4) = "V"
  130.     Case "9"
  131.     letters(cnt2, 2) = "W"
  132.     letters(cnt2, 3) = "X"
  133.     letters(cnt2, 4) = "Y"
  134.     Case Else
  135.     MsgBox "The number " & letters(cnt2, 1) & " does not have any associated letters.  There will be a blank space in its place."
  136.     letters(cnt2, 2) = "_"
  137.     letters(cnt2, 3) = "_"
  138.     letters(cnt2, 4) = "_"
  139.     End Select
  140. Next cnt2
  141. Dim c1 As Integer
  142. Dim c2 As Integer
  143. Dim c3 As Integer
  144. Dim c4 As Integer
  145. Dim word As String
  146. For c1 = 2 To 4
  147. For c2 = 2 To 4
  148. For c3 = 2 To 4
  149. For c4 = 2 To 4
  150. word = letters(1, c1) & letters(2, c2) & letters(3, c3) & letters(4, c4)
  151. list1.AddItem word
  152. Next c4
  153. Next c3
  154. Next c2
  155. Next c1
  156.     label1.Caption = "List count: " & list1.ListCount
  157. End Sub
  158.